<!DOCTYPE html>
<html>
<head>
    <link rel="shortcut icon" type="image/ico" href="/static/common/assets/favicon.ico">

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Cache-Control" content="no-cache">

	  {% load static %}
	  <link rel="stylesheet" href="{% static "css/bootstrap.min.css" %}">
    <link rel="stylesheet" type="text/css" href="{% static "css/ns-login.css" %}">

    <script type="text/javascript" src="{% static "js/jquery-3.5.1.slim.min.js" %}"></script>
    <script type="text/javascript" src="{% static "js/aes.js" %}"></script>

    <script type="text/javascript">
        var netscout = {};
        netscout.nslogin = {};
        netscout.nslogin = {
            encrypt:function(){
                var displayPassword= document.loginform.password.value;
                var theKey = "7B355CBDA832F79610543A5D4B7BA231";
                var aesEncryptionEnabled = "true";

                if (aesEncryptionEnabled.trim() === "false") {
                    var stheKey = theKey.substring(0,8);
                    document.loginform.password.value = $.rc4EncryptStr(displayPassword, stheKey );
                }
                else {
                    var stheKey = theKey.substring(0,16);
                    var stheKey32 = stheKey + stheKey;
                    var key = CryptoJS.enc.Utf8.parse(stheKey32);
                    var iv= CryptoJS.enc.Utf8.parse('ulFAiLTrKotxpnPV');

                    var encrypted = CryptoJS.AES.encrypt(displayPassword, key, { iv: iv });
                    var cipherText = encrypted.ciphertext.toString();
                    document.loginform.password.value = cipherText;
                }

                var username = document.loginform.username.value;
                var un =  encodeURIComponent(username);
                document.loginform.username.value = un;
            },
        };
     </script>

    <title>TSA ONLINE</title>

</head>
<body  class="text-center">

  <div class="limiter">
    <div class="container-login100">
      <div class="wrap-login100 p-l-50 p-r-50 p-t-40 p-b-10">
        <form action="/dappx/user_login/" method="post" name="loginform" class="login100-form validate-form flex-sb flex-w">
					{% csrf_token %}
          <span class="login100-form-title p-b-32">
            TSA Online 
          </span>

          <span class="txt1 p-b-11">
            Username
          </span>
          <div class="wrap-input100 validate-input m-b-36" data-validate = "Username is required">
            <input id="usernameText" class="input100" type="text" name="username" maxlength="100" >
            <span class="focus-input100"></span>
          </div>
          
          <span class="txt1 p-b-11">
            Password
          </span>
          <div class="wrap-input100 validate-input m-b-12" data-validate = "Password is required">
            <span class="btn-show-pass">
              <i class="fa fa-eye"></i>
            </span>
            <!-- <input class="input100" type="password" name="pass" > -->
            <input id="passwordText" class="input100" type="password" name="password" maxlength="100">
            <span class="focus-input100"></span>
          </div>
          
          <div class="flex-sb-m w-full p-b-48">
            <div class="contact100-form-checkbox">
              <input class="input-checkbox100" id="ckb1" type="checkbox" name="remember-me">
              <label class="label-checkbox100" for="ckb1">
                Remember me
              </label>
            </div>

            <div>
              <a href="/dappx/register" class="txt3">
               Register 
              </a>
            </div>


          </div>

          <div class="container-login100-form-btn">
            <input class="login100-form-btn" id="submitBtn" type="submit" onclick="netscout.nslogin.encrypt();" value="Login">
          </div>

        </form>

        <br>
            <label id="copyrightLabel" class="mt-5 mb-3 text-muted">©2020 NETSCOUT</label>

    </div>

  </div>

</body>

</html>
